﻿using System;
using System.Collections.Generic;
using STeaL.Functional;

namespace STeaL.Algorithm {

  public static partial class IListExtensions {
#region front
    public static T front<T>(this IList<T> list) 
      { return list[0]; }

#endregion
#region push_front
    public static void push_front<T>(this IList<T> list, T item) 
      { list.Insert(0, item); }

#endregion
#region pop_front
    public static void pop_front<T>(this IList<T> list)
      { list.RemoveAt(0); }

    public static void pop_front<T>(this IList<T> list, out T val) {
      val = list.front();
      list.pop_front();
    }

#endregion
  }
}
